<!DOCTYPE html>
<html lang="en">
<head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
    <meta charset="UTF-8">
    <title>Document</title>
    <link media="all" href="/public/menu/css/index_1.css" type="text/css" rel="stylesheet">
<style>
	.contlist {width:20%;float:left; height: 52px;line-height: 52px;text-align: center;}
	.contlist .box a {text-align:center;display: block;height:40px; line-height: 40px; border:1px solid #e8e8e8;color:#333;margin:5px;border-radius: 4px;}
	.contlist .box {}
	</style>
</head>
<body>
<div class="metv5box" style="margin-top: 30px;">
    <ul class="columnlist" id="test">
        <li class="contlist">
            <div class="box">
                <a href="javascript:;" onclick="select_menu(this)"
                   data-imgurl="/yb_shop/pages/index/index" data-key="index" data-name="首页">
                    首页
                </a>
            </div>
        </li>
        {if $this_id!=0}
        <li class="contlist">
            <div class="box">
                <a href="javascript:;" onclick="select_goods_list(this)" data-imgurl="" data-key="" data-name="商品列表">
                    商品列表</a>
            </div>
        </li>
        <li class="contlist">
            <div class="box">
                <a href="javascript:;" onclick="get_view_select(this)"
                   data-imgurl="/yb_shop/pages/goods/detail/index" data-key="goods_detail" data-name="商品详情">
                    商品详情</a>
            </div>
        </li>
        <li class="contlist">
            <div class="box">
                <a href="javascript:;" onclick="select_menu(this)"
                   data-imgurl="/yb_shop/pages/class_article/index" data-key="class_article" data-name="文章分类">
                    文章分类</a>
            </div>
        </li>
        <li class="contlist">
            <div class="box">
                <a href="javascript:;" onclick="select_menu(this)"
                   data-imgurl="/yb_shop/pages/class_image/index" data-key="class_image" data-name="相册分类">
                    相册分类</a>
            </div>
        </li>
        <li class="contlist">
            <div class="box" style="height: 80px;">
                <a href="javascript:;" onclick="select_menu(this)"
                   data-imgurl="/yb_shop/pages/contact/index" data-key="contact" data-name="联系我们">
                    联系我们</a>
            </div>
        </li>
        <li class="contlist">
            <div class="box">
                <a href="javascript:;"
                   onclick="select_menu(this)"
                   data-imgurl="/yb_shop/pages/find/index" data-key="index" data-name="文章列表">
                    文章列表</a>
            </div>
        </li>
        <li class="contlist">
            <div class="box">
                <a href="javascript:;" onclick="get_view_select(this)"
                   data-imgurl="" data-key="find_info" data-name="文章详情">
                    文章详情
                </a>
            </div>
        </li>
        <li class="contlist">
            <div class="box">
                <a href="javascript:;" onclick="get_view_select(this)"
                   data-imgurl="" data-key="image" data-name="图片列表">
                    图片列表 </a>
            </div>
        </li>
        <li class="contlist">
            <div class="box">
                <a href="javascript:;" onclick="select_menu(this)"
                   data-imgurl="/yb_shop/pages/member/index/index" data-key="member_index" data-name="会员中心">
                    会员中心</a>
            </div>
        </li>
        <li class="contlist">
            <div class="box">
                <a href="javascript:;" onclick="select_menu(this)"
                   data-imgurl="/yb_shop/pages/member/cart/index" data-key="member_cart" data-name="购物车" >
                    购物车
                </a>
            </div>
        </li>
        <li class="contlist">
            <div class="box">
                <a href="javascript:;" onclick="select_menu(this)"
                   data-imgurl="/yb_shop/pages/member/address/index" data-key="member_address" data-name="收货地址">
                    收货地址</a>
            </div>
        </li>
        <li class="contlist">
            <div class="box">
                <a href="javascript:;" onclick="select_menu(this)"
                   data-imgurl="/yb_shop/pages/member/coupon/index" data-key="member_coupon" data-name="我的优惠卷">
                    我的优惠卷</a>
            </div>
        </li>
        <li class="contlist">
            <div class="box">
                <a href="javascript:;" onclick="select_menu(this)"
                   data-imgurl="/yb_shop/pages/member/favorite/index" data-key="member_favorite" data-name="我的收藏">
                    我的收藏 </a>
            </div>
        </li>
        <li class="contlist">
            <div class="box">
                <a href="javascript:;" onclick="select_menu(this)"
                   data-imgurl="/yb_shop/pages/member/about/index" data-key="member_about" data-name="关于我们">
                    关于我们
                </a>
            </div>
        </li>
        <li class="contlist">
            <div class="box">
                <a href="javascript:;" onclick="select_menu(this)"
                   data-imgurl="/yb_shop/pages/order/index" data-key="order" data-name="订单">
                    订单  </a>
            </div>
        </li>
        <li class="contlist">
            <div class="box">
                <a href="javascript:;" onclick="select_menu(this)"
                   data-imgurl="/yb_shop/pages/book_list/index" data-key="book_list" data-name="预约列表">
                    预约列表
                </a>
            </div>
        </li>
        <li class="contlist">
            <div class="box">
                <a href="javascript:;" onclick="select_menu(this)"
                   data-imgurl="/yb_shop/pages/shop_coupon/index" data-key="shop_coupon" data-name="优惠券">
                    优惠券
                </a>
            </div>
        </li>
        <li class="contlist">
            <div class="box">
                <a href="javascript:;" onclick="select_menu(this)"
                   data-imgurl="/yb_shop/pages/goods/index/index" data-key="goods_index" data-name="搜索">
                    搜索
                </a>
            </div>
        </li>
        <li class="contlist">
            <div class="box">
                <a href="javascript:;" onclick="get_view_select(this)" data-imgurl="" data-key="power" data-name="万能页面">
                    万能页面
                </a>
            </div>
        </li>
        <li class="contlist">
            <div class="box">
                <a href="javascript:;" onclick="select_menu(this)"
                   data-imgurl="/yb_shop/pages/kanjia/index/index" data-key="kanjia_index" data-name="砍价">
                    砍价
                </a>
            </div>
        </li>
        <li class="contlist">
            <div class="box">
                <a href="javascript:;" onclick="select_menu(this)"
                   data-imgurl="/yb_shop/pages/pintuan/pages/index/index" data-key="pintuan_index" data-name="拼团">
                    拼团
                </a>
            </div>
        </li>
        <li class="contlist">
            <div class="box">
                <a href="javascript:;" onclick="get_view_select(this)" data-imgurl="" data-key="applets" data-name="小程序">
                    小程序
                </a>
            </div>
        </li>
        <li class="contlist">
            <div class="box">
                <a href="javascript:;" onclick="get_view_select(this)" data-imgurl="" data-key="web_page" data-name="网页">
                    网页
                </a>
            </div>
        </li>
        <li class="contlist">
            <div class="box">
                <a href="javascript:;" onclick="get_view_phone(this)" data-imgurl="" data-key="call_phone" data-name="打电话">
                    打电话
                </a>
            </div>
        </li>
        <li class="contlist">
            <div class="box">
                <a href="javascript:;" onclick="get_view_phone(this)" data-imgurl="" data-key="map" data-name="地图">
                    地图
                </a>
            </div>
        </li>
        {/if}
    </ul>
</div>
<script src="/public/js/jquery-2.1.1.js" type="text/javascript"></script>
<script type="text/javascript" src="/public/static/layer/2.4/layer.js"></script>
<script type="text/javascript">
    $(".box").click(function () {
        $('.selectedb').removeClass('selectedb');
        $(this).addClass('selectedb');
    });
    //没有页面的
    function select_menu(obj) {
        var item = {};
        item["imgurl"] =  $(obj).attr('data-imgurl');
        item['name'] = $(obj).attr('data-name');
        item['key'] =  $(obj).attr('data-key');
        parent.get_not_attr_di('{$this_id}',item);
        parent.layer.closeAll();
    }
    //打电话组件
    function get_view_phone(obj) {
        var key =  $(obj).attr('data-key');
        if (key=='call_phone'){
            layer.prompt({title: '输入电话号码', formType: 0}, function (text, index) {
                var item = {};
                item["imgurl"] = '';
                item["phone"] = text;
                item['name'] = '电话';
                item['ident'] = 4;
                item['key'] =  key;
                parent.get_not_attr_di('{$this_id}',item);
                parent.layer.closeAll();
            });
        }
        if (key=='map'){
            layer_open('坐标', '__CONF_SITE__admin/menu/index_select_position','100%', '100%');
        }
    }
    function get_position(lat,lng) {
        var item = {};
        item["imgurl"] = '';
        item['name'] = '地图';
        item['lat'] = lat;
        item['lng'] = lng;
        item['ident'] = 5;
        item['key'] =  'map';
        parent.get_not_attr_di('{$this_id}',item);
        parent.layer.closeAll();
    }
    //有页面的
    function get_view_select(obj) {
        var key =  $(obj).attr('data-key');
        if (key=='goods_detail'){//商品详情
            layer_open('选择商品','__CONF_SITE__admin/menu/get_view_select&this_id={$this_id}&type=goods_detail','100%','100%');
        }
        if (key=='find_info'){//商品详情
            layer_open('选择文章','__CONF_SITE__admin/menu/get_view_select&this_id={$this_id}&type=find_info','100%','100%');
        }
        if (key=='image'){//商品详情
            layer_open('选择相册','__CONF_SITE__admin/menu/get_view_select&this_id={$this_id}&type=image','100%','100%');
        }
        if (key=='find'){//商品详情
            layer_open('选择分类','__CONF_SITE__admin/menu/get_view_select&this_id={$this_id}&type=find','100%','100%');
        }
        if (key=='power'){//商品详情
            layer_open('选择页面','__CONF_SITE__admin/menu/get_view_select&this_id={$this_id}&type=power','100%','100%');
        }
        if (key=='form'){//商品详情
            layer_open('选择表单','__CONF_SITE__admin/menu/get_view_select&this_id={$this_id}&type=form','100%','100%');
        }
        if (key=='applets'){
            layer_open('选择小程序','__CONF_SITE__admin/menu/get_view_select&this_id={$this_id}&type=applets','100%','100%');
        }
        if (key=='web_page'){
            layer_open('选择页面','__CONF_SITE__admin/menu/get_view_select&this_id={$this_id}&type=web_page','100%','100%');
        }
    }
    /*菜单模版*/
    function layer_open(title,url,w,h){
        layer.open({
            type: 2,
            area: [w, h],
            fix: false, //不固定
            maxmin: true,
            shade:0.4,
            title: title,
            content: url,
            scrollbar:false
        });
    }
    //回调
    function get_not_attr(this_id,item) {
        parent.get_not_attr_di(this_id,item);
        parent.layer.closeAll();
    }
    //商品
    function select_goods_list(obj) {
        layer_open('选择模版','__CONF_SITE__admin/menu/di_select_mod_all_goods&this_id={$this_id}','100%','100%');
    }
</script>
</body>
</html>
